package com.core.gig.negocio;


import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


@Entity
@Table(name = "TB_ATIVO")
@SequenceGenerator(name = "SQ_ATIVO", sequenceName = "SQ_ATIVO")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "TIPO", discriminatorType = DiscriminatorType.STRING, length = 3)
public class AtivoImobilizado implements Serializable
{

	private static final long serialVersionUID = -4864662142392212190L;
	private int id;
	private String nome;
	private String descricao;
	private double valor;
	private int tempoVida;
	private int residual;
	private double depreciacao;
	private double manutencao;
	
	@Id
	@Column (name = "ID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_ATIVO")
	public int getId()
	{
		return id;
	}
	
	@Column(name = "NOME", nullable = false, length = 100)
	public String getNome()
	{
		return nome;
	}
	
	@Column(name = "DESCRICAO", nullable = true, length = 4000)
	public String getDescricao()
	{
		return descricao;
	}
	
	@Column(name = "VALOR", nullable = false, precision = 2)
	public double getValor()
	{
		return valor;
	}
	
	@Column(name = "TEMPO_VIDA", nullable = false)
	public int getTempoVida()
	{
		return tempoVida;
	}
	
	@Column(nullable = false)
	public int getResidual()
	{
		return residual;
	}
	
	@Column(nullable = false, precision = 2)
	public double getDepreciacao()
	{
		return depreciacao;
	}
	
	@Column(nullable = false, precision = 2)
	public double getManutencao()
	{
		return manutencao;
	}
	public void setId(int id)
	{
		this.id = id;
	}
	public void setNome(String nome)
	{
		this.nome = nome;
	}
	public void setDescricao(String descricao)
	{
		this.descricao = descricao;
	}
	public void setValor(double valor)
	{
		this.valor = valor;
	}
	public void setTempoVida(int tempoVida)
	{
		this.tempoVida = tempoVida;
	}
	public void setResidual(int residual)
	{
		this.residual = residual;
	}
	public void setDepreciacao(double depreciacao)
	{
		this.depreciacao = depreciacao;
	}
	public void setManutencao(double manutencao)
	{
		this.manutencao = manutencao;
	}
}